home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / MPW / gzip 1.2.2 / configure < prev    next >
Encoding:
Text File  |  1993-06-22  |  22.9 KB  |  1,025 lines  |  [TEXT/MPS ]

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  74.        verbose=yes ;;
  75.  
  76.      *) ;;
  77.     esac
  78.   fi
  79. done
  80.  
  81. trap 'rm -f conftest* core; exit 1' 1 3 15
  82.  
  83. # Needed for some versions of `tr' so that character classes in `[]' work.
  84. #if test "${LANG+set}" = "set" ; then
  85.    LANG=C
  86.    LC_ALL=C
  87.    export LANG LC_ALL
  88. #fi
  89.  
  90. rm -f conftest*
  91. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  92.  
  93. # A filename unique to this package, relative to the directory that
  94. # configure is in, which we can look for to find out if srcdir is correct.
  95. unique_file=gzip.c
  96.  
  97. # Find the source files, if location was not specified.
  98. if test -z "$srcdir"; then
  99.   srcdirdefaulted=yes
  100.   # Try the directory containing this script, then `..'.
  101.   prog=$0
  102.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  103.   test "X$confdir" = "X$prog" && confdir=.
  104.   srcdir=$confdir
  105.   if test ! -r $srcdir/$unique_file; then
  106.     srcdir=..
  107.   fi
  108. fi
  109. if test ! -r $srcdir/$unique_file; then
  110.   if test x$srcdirdefaulted = xyes; then
  111.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  112.   else
  113.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  114.   fi
  115.   exit 1
  116. fi
  117. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  118. # But we can't avoid them for `..', to make subdirectories work.
  119. case $srcdir in
  120.   .|/*|~*) ;;
  121.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  122. esac
  123.  
  124. if test -z "$CC"; then
  125.   # Extract the first word of `gcc', so it can be a program name with args.
  126.   set dummy gcc; word=$2
  127.   echo checking for $word
  128.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  129.   for dir in $PATH; do
  130.     test -z "$dir" && dir=.
  131.     if test -f $dir/$word; then
  132.       CC="gcc"
  133.       break
  134.     fi
  135.   done
  136.   IFS="$saveifs"
  137. fi
  138. test -z "$CC" && CC="cc"
  139. test -n "$CC" -a -n "$verbose" && echo "    setting CC to $CC"
  140.  
  141. # Find out if we are using GNU C, under whatever name.
  142. cat > conftest.c <<EOF
  143. #ifdef __GNUC__
  144.   yes
  145. #endif
  146. EOF
  147. ${CC-cc} -E conftest.c > conftest.out 2>&1
  148. if egrep yes conftest.out >/dev/null 2>&1; then
  149.   GCC=1 # For later tests.
  150.   CFLAGS="${CFLAGS--O}"
  151. fi
  152. rm -f conftest*
  153.  
  154. echo checking for underline in external names
  155. test -z "$CPP" -a -f /lib/cpp && CPP=/lib/cpp
  156. test -z "$CPP" && CPP="$CC -E"
  157. cat > conftest.c <<EOF
  158. int foo() {return 0;}
  159. EOF
  160. eval "$CC -c conftest.c > /dev/null 2>&1"
  161. if nm conftest.o | grep _foo > /dev/null 2>&1 ; then
  162.   :
  163. else
  164.   CPP="${CPP} -DNO_UNDERLINE"
  165. fi
  166. rm -f _match.o conftest.c conftest.o
  167. if echo "$DEFS" | grep NO_ASM >/dev/null; then
  168.   :
  169. else
  170.   echo checking for assembler
  171.   OBJA=""
  172.   if eval "$CPP $srcdir/match.S > _match.s 2>/dev/null"; then
  173.     if test ! -s _match.s || grep error < _match.s > /dev/null; then
  174.       :
  175.     elif eval "$CC -c _match.s >/dev/null 2>&1" && test -f _match.o; then
  176.       DEFS="${DEFS} -DASMV"
  177.       OBJA=match.o
  178.     fi
  179.   fi
  180.   rm -f _match.s _match.o
  181. fi
  182. # Make sure to not get the incompatible SysV /etc/install and
  183. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  184. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  185. # or the AFS install, which mishandles nonexistent args, or
  186. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  187. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  188. # anyway.  Sigh.
  189. if test "z${INSTALL}" = "z" ; then
  190.   echo checking for install
  191.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  192.   for dir in $PATH; do
  193.     test -z "$dir" && dir=.
  194.     case $dir in
  195.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  196.     *)
  197.       if test -f $dir/installbsd; then
  198.     INSTALL="$dir/installbsd -c" # OSF1
  199.     INSTALL_PROGRAM='$(INSTALL)'
  200.     INSTALL_DATA='$(INSTALL) -m 644'
  201.     break
  202.       fi
  203.       if test -f $dir/install; then
  204.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  205.       : # AIX
  206.     else
  207.       INSTALL="$dir/install -c"
  208.       INSTALL_PROGRAM='$(INSTALL)'
  209.       INSTALL_DATA='$(INSTALL) -m 644'
  210.       break
  211.     fi
  212.       fi
  213.       ;;
  214.     esac
  215.   done
  216.   IFS="$saveifs"
  217. fi
  218. INSTALL=${INSTALL-cp}
  219. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  220. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  221.  
  222. echo checking for AIX
  223. echo checking how to run the C preprocessor
  224. if test -z "$CPP"; then
  225.   CPP='${CC-cc} -E'
  226.   cat > conftest.c <<EOF
  227. #include <stdio.h>
  228. EOF
  229. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  230. if test -z "$err"; then
  231.   :
  232. else
  233.   CPP=/lib/cpp
  234. fi
  235. rm -f conftest*
  236. fi
  237.  
  238. cat > conftest.c <<EOF
  239. #ifdef _AIX
  240.   yes
  241. #endif
  242.  
  243. EOF
  244. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  245. if egrep "yes" conftest.out >/dev/null 2>&1; then
  246.   {
  247. test -n "$verbose" && \
  248. echo '    defining' _ALL_SOURCE
  249. DEFS="$DEFS -D_ALL_SOURCE=1"
  250. }
  251.  
  252. fi
  253. rm -f conftest*
  254.  
  255.  
  256. echo checking for minix/config.h
  257. cat > conftest.c <<EOF
  258. #include <minix/config.h>
  259. EOF
  260. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  261. if test -z "$err"; then
  262.   MINIX=1
  263. fi
  264. rm -f conftest*
  265.  
  266. # The Minix shell can't assign to the same variable on the same line!
  267. if test -n "$MINIX"; then
  268.   {
  269. test -n "$verbose" && \
  270. echo '    defining' _POSIX_SOURCE
  271. DEFS="$DEFS -D_POSIX_SOURCE=1"
  272. }
  273.  
  274.   {
  275. test -n "$verbose" && \
  276. echo '    defining' _POSIX_1_SOURCE to be '2'
  277. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  278. }
  279.  
  280.   {
  281. test -n "$verbose" && \
  282. echo '    defining' _MINIX
  283. DEFS="$DEFS -D_MINIX=1"
  284. }
  285.  
  286. fi
  287.  
  288. echo checking for POSIXized ISC
  289. if test -d /etc/conf/kconfig.d &&
  290.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  291. then
  292.   ISC=1 # If later tests want to check for ISC.
  293.   {
  294. test -n "$verbose" && \
  295. echo '    defining' _POSIX_SOURCE
  296. DEFS="$DEFS -D_POSIX_SOURCE=1"
  297. }
  298.  
  299.   if test -n "$GCC"; then
  300.     CC="$CC -posix"
  301.   else
  302.     CC="$CC -Xp"
  303.   fi
  304. fi
  305.  
  306. echo checking for DYNIX/ptx libseq
  307. cat > conftest.c <<EOF
  308. #if defined(_SEQUENT_)
  309.   yes
  310. #endif
  311.  
  312. EOF
  313. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  314. if egrep "yes" conftest.out >/dev/null 2>&1; then
  315.   SEQUENT=1
  316. fi
  317. rm -f conftest*
  318.  
  319. test -n "$SEQUENT" && test -f /usr/lib/libseq.a &&
  320.   LIBS="$LIBS -lseq"
  321.  
  322. echo checking for ANSI C header files
  323. cat > conftest.c <<EOF
  324. #include <stdlib.h>
  325. #include <stdarg.h>
  326. #include <string.h>
  327. #include <float.h>
  328. EOF
  329. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  330. if test -z "$err"; then
  331.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  332. echo '#include <string.h>' > conftest.c
  333. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  334. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  335.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  336. cat > conftest.c <<EOF
  337. #include <ctype.h>
  338. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  339. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  340. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  341. int main () { int i; for (i = 0; i < 256; i++)
  342. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  343. exit (0); }
  344.  
  345. EOF
  346. eval $compile
  347. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  348.   {
  349. test -n "$verbose" && \
  350. echo '    defining' STDC_HEADERS
  351. DEFS="$DEFS -DSTDC_HEADERS=1"
  352. }
  353.  
  354. fi
  355. rm -f conftest*
  356. fi
  357. rm -f conftest*
  358.  
  359. fi
  360. rm -f conftest*
  361.  
  362. echo checking for string.h
  363. cat > conftest.c <<EOF
  364. #include <string.h>
  365. EOF
  366. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  367. if test -z "$err"; then
  368.   :
  369. else
  370.   {
  371. test -n "$verbose" && \
  372. echo '    defining' NO_STRING_H
  373. DEFS="$DEFS -DNO_STRING_H=1"
  374. }
  375.  
  376. fi
  377. rm -f conftest*
  378.  
  379. echo checking for stdlib.h
  380. cat > conftest.c <<EOF
  381. #include <stdlib.h>
  382. EOF
  383. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  384. if test -z "$err"; then
  385.   :
  386. else
  387.   {
  388. test -n "$verbose" && \
  389. echo '    defining' NO_STDLIB_H
  390. DEFS="$DEFS -DNO_STDLIB_H=1"
  391. }
  392.  
  393. fi
  394. rm -f conftest*
  395.  
  396. echo checking for memory.h
  397. cat > conftest.c <<EOF
  398. #include <memory.h>
  399. EOF
  400. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  401. if test -z "$err"; then
  402.   :
  403. else
  404.   {
  405. test -n "$verbose" && \
  406. echo '    defining' NO_MEMORY_H
  407. DEFS="$DEFS -DNO_MEMORY_H=1"
  408. }
  409.  
  410. fi
  411. rm -f conftest*
  412.  
  413. echo checking for fcntl.h
  414. cat > conftest.c <<EOF
  415. #include <fcntl.h>
  416. EOF
  417. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  418. if test -z "$err"; then
  419.   :
  420. else
  421.   {
  422. test -n "$verbose" && \
  423. echo '    defining' NO_FCNTL_H
  424. DEFS="$DEFS -DNO_FCNTL_H=1"
  425. }
  426.  
  427. fi
  428. rm -f conftest*
  429.  
  430. echo checking for time.h
  431. cat > conftest.c <<EOF
  432. #include <time.h>
  433. EOF
  434. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  435. if test -z "$err"; then
  436.   :
  437. else
  438.   {
  439. test -n "$verbose" && \
  440. echo '    defining' NO_TIME_H
  441. DEFS="$DEFS -DNO_TIME_H=1"
  442. }
  443.  
  444. fi
  445. rm -f conftest*
  446.  
  447. for hdr in unistd.h
  448. do
  449. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  450. echo checking for ${hdr}
  451. cat > conftest.c <<EOF
  452. #include <${hdr}>
  453. EOF
  454. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  455. if test -z "$err"; then
  456.   {
  457. test -n "$verbose" && \
  458. echo '    defining' ${trhdr}
  459. DEFS="$DEFS -D${trhdr}=1"
  460. }
  461.  
  462. fi
  463. rm -f conftest*
  464. done
  465.  
  466. utime=0
  467. echo checking for utime.h
  468. cat > conftest.c <<EOF
  469. #include <utime.h>
  470. EOF
  471. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  472. if test -z "$err"; then
  473.   utime=1 
  474. else
  475.   {
  476. test -n "$verbose" && \
  477. echo '    defining' NO_UTIME_H
  478. DEFS="$DEFS -DNO_UTIME_H=1"
  479. }
  480.  
  481. fi
  482. rm -f conftest*
  483.  
  484. if test $utime -eq 0; then
  485.   for hdr in sys/utime.h
  486. do
  487. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  488. echo checking for ${hdr}
  489. cat > conftest.c <<EOF
  490. #include <${hdr}>
  491. EOF
  492. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  493. if test -z "$err"; then
  494.   {
  495. test -n "$verbose" && \
  496. echo '    defining' ${trhdr}
  497. DEFS="$DEFS -D${trhdr}=1"
  498. }
  499.  
  500. fi
  501. rm -f conftest*
  502. done
  503.  
  504. fi
  505. echo checking for directory library header
  506. dirheader=
  507. if test -z "$dirheader"; then
  508.   echo checking for dirent.h
  509. cat > conftest.c <<EOF
  510. #include <sys/types.h>
  511. #include <dirent.h>
  512. int main() { exit(0); }
  513. int t() { DIR *dirp = opendir ("/"); }
  514. EOF
  515. if eval $compile; then
  516.   {
  517. test -n "$verbose" && \
  518. echo '    defining' DIRENT
  519. DEFS="$DEFS -DDIRENT=1"
  520. }
  521.  dirheader=dirent.h
  522. fi
  523. rm -f conftest*
  524. fi
  525. if test -z "$dirheader"; then
  526.   echo checking for sys/ndir.h
  527. cat > conftest.c <<EOF
  528. #include <sys/types.h>
  529. #include <sys/ndir.h>
  530. int main() { exit(0); }
  531. int t() { DIR *dirp = opendir ("/"); }
  532. EOF
  533. if eval $compile; then
  534.   {
  535. test -n "$verbose" && \
  536. echo '    defining' SYSNDIR
  537. DEFS="$DEFS -DSYSNDIR=1"
  538. }
  539.  dirheader=sys/ndir.h
  540. fi
  541. rm -f conftest*
  542. fi
  543. if test -z "$dirheader"; then
  544.   echo checking for sys/dir.h
  545. cat > conftest.c <<EOF
  546. #include <sys/types.h>
  547. #include <sys/dir.h>
  548. int main() { exit(0); }
  549. int t() { DIR *dirp = opendir ("/"); }
  550. EOF
  551. if eval $compile; then
  552.   {
  553. test -n "$verbose" && \
  554. echo '    defining' SYSDIR
  555. DEFS="$DEFS -DSYSDIR=1"
  556. }
  557.  dirheader=sys/dir.h
  558. fi
  559. rm -f conftest*
  560. fi
  561. if test -z "$dirheader"; then
  562.   echo checking for ndir.h
  563. cat > conftest.c <<EOF
  564. #include <sys/types.h>
  565. #include <ndir.h>
  566. int main() { exit(0); }
  567. int t() { DIR *dirp = opendir ("/"); }
  568. EOF
  569. if eval $compile; then
  570.   {
  571. test -n "$verbose" && \
  572. echo '    defining' NDIR
  573. DEFS="$DEFS -DNDIR=1"
  574. }
  575.  dirheader=ndir.h
  576. fi
  577. rm -f conftest*
  578. fi
  579.  
  580. echo checking for closedir return value
  581. cat > conftest.c <<EOF
  582. #include <sys/types.h>
  583. #include <$dirheader>
  584. int closedir(); main() { exit(closedir(opendir(".")) != 0); }
  585. EOF
  586. eval $compile
  587. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  588.   :
  589. else
  590.   {
  591. test -n "$verbose" && \
  592. echo '    defining' VOID_CLOSEDIR
  593. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  594. }
  595.  
  596. fi
  597. rm -f conftest*
  598.  
  599. echo checking for Xenix
  600. cat > conftest.c <<EOF
  601. #if defined(M_XENIX) && !defined(M_UNIX)
  602.   yes
  603. #endif
  604.  
  605. EOF
  606. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  607. if egrep "yes" conftest.out >/dev/null 2>&1; then
  608.   XENIX=1
  609. fi
  610. rm -f conftest*
  611.  
  612. if test -n "$XENIX"; then
  613.   LIBS="$LIBS -lx"
  614.   case "$DEFS" in
  615.   *SYSNDIR*) ;;
  616.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  617.   esac
  618. fi
  619.  
  620. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  621. # for constant arguments.  Useless!
  622. echo checking for working alloca.h
  623. cat > conftest.c <<EOF
  624. #include <alloca.h>
  625. int main() { exit(0); }
  626. int t() { char *p = alloca(2 * sizeof(int)); }
  627. EOF
  628. if eval $compile; then
  629.   {
  630. test -n "$verbose" && \
  631. echo '    defining' HAVE_ALLOCA_H
  632. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  633. }
  634.  
  635. fi
  636. rm -f conftest*
  637.  
  638. decl="#ifdef __GNUC__
  639. #define alloca __builtin_alloca
  640. #else
  641. #if HAVE_ALLOCA_H
  642. #include <alloca.h>
  643. #else
  644. #ifdef _AIX
  645.  #pragma alloca
  646. #else
  647. #ifdef supermax
  648. /* On Supermax, cc returns 0 for an include of an non existing .h file */
  649.  error
  650. #else
  651. char *alloca ();
  652. #endif
  653. #endif
  654. #endif
  655. #endif
  656. "
  657. echo checking for alloca
  658. cat > conftest.c <<EOF
  659. $decl
  660. int main() { exit(0); }
  661. int t() { char *p = (char *) alloca(1); }
  662. EOF
  663. if eval $compile; then
  664.   :
  665. else
  666.   alloca_missing=1
  667. cat > conftest.c <<EOF
  668.  
  669. #if defined(CRAY) && ! defined(CRAY2)
  670. winnitude
  671. #else
  672. lossage
  673. #endif
  674.  
  675. EOF
  676. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  677. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  678.   echo checking for _getb67
  679. cat > conftest.c <<EOF
  680. #include <ctype.h>
  681. int main() { exit(0); }
  682. int t() { 
  683. /* The GNU C library defines this for functions which it implements
  684.     to always fail with ENOSYS.  Some functions are actually named
  685.     something starting with __ and the normal name is an alias.  */
  686. #if defined (__stub__getb67) || defined (__stub____getb67)
  687. choke me
  688. #else
  689. /* Override any gcc2 internal prototype to avoid an error.  */
  690. extern char _getb67(); _getb67();
  691. #endif
  692.  }
  693. EOF
  694. if eval $compile; then
  695.   {
  696. test -n "$verbose" && \
  697. echo '    defining' CRAY_STACKSEG_END to be '_getb67'
  698. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  699. }
  700.  
  701. else
  702.   echo checking for GETB67
  703. cat > conftest.c <<EOF
  704. #include <ctype.h>
  705. int main() { exit(0); }
  706. int t() { 
  707. /* The GNU C library defines this for functions which it implements
  708.     to always fail with ENOSYS.  Some functions are actually named
  709.     something starting with __ and the normal name is an alias.  */
  710. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  711. choke me
  712. #else
  713. /* Override any gcc2 internal prototype to avoid an error.  */
  714. extern char GETB67(); GETB67();
  715. #endif
  716.  }
  717. EOF
  718. if eval $compile; then
  719.   {
  720. test -n "$verbose" && \
  721. echo '    defining' CRAY_STACKSEG_END to be 'GETB67'
  722. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  723. }
  724.  
  725. else
  726.   echo checking for getb67
  727. cat > conftest.c <<EOF
  728. #include <ctype.h>
  729. int main() { exit(0); }
  730. int t() { 
  731. /* The GNU C library defines this for functions which it implements
  732.     to always fail with ENOSYS.  Some functions are actually named
  733.     something starting with __ and the normal name is an alias.  */
  734. #if defined (__stub_getb67) || defined (__stub___getb67)
  735. choke me
  736. #else
  737. /* Override any gcc2 internal prototype to avoid an error.  */
  738. extern char getb67(); getb67();
  739. #endif
  740.  }
  741. EOF
  742. if eval $compile; then
  743.   {
  744. test -n "$verbose" && \
  745. echo '    defining' CRAY_STACKSEG_END to be 'getb67'
  746. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  747. }
  748.  
  749. fi
  750. rm -f conftest*
  751.  
  752. fi
  753. rm -f conftest*
  754.  
  755. fi
  756. rm -f conftest*
  757.  
  758. fi
  759. rm -f conftest*
  760.  
  761.  
  762. fi
  763. rm -f conftest*
  764.  
  765. if test -n "$alloca_missing"; then
  766.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  767.   # that cause trouble.  Some versions do not even contain alloca or
  768.   # contain a buggy version.  If you still want to use their alloca,
  769.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  770.   ALLOCA=alloca.o
  771. if test -z "check_stack_dir"; then
  772.   echo 'checking stack direction for C alloca'
  773.   echo checking whether cross-compiling
  774. # If we cannot run a trivial program, we must be cross compiling.
  775. cat > conftest.c <<EOF
  776. main(){exit(0);}
  777. EOF
  778. eval $compile
  779. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  780.   :
  781. else
  782.   cross_compiling=1
  783. fi
  784. rm -f conftest*
  785.  
  786. if test -n "$cross_compiling"
  787. then
  788.   {
  789. test -n "$verbose" && \
  790. echo '    defining' STACK_DIRECTION to be '0'
  791. DEFS="$DEFS -DSTACK_DIRECTION=0"
  792. }
  793.  
  794. else
  795. cat > conftest.c <<EOF
  796. find_stack_direction ()
  797. {
  798.   static char *addr = 0;
  799.   auto char dummy;
  800.   if (addr == 0)
  801.     {
  802.       addr = &dummy;
  803.       return find_stack_direction ();
  804.     }
  805.   else
  806.     return (&dummy > addr) ? 1 : -1;
  807. }
  808. main ()
  809. {
  810.   exit (find_stack_direction() < 0);
  811. }
  812. EOF
  813. eval $compile
  814. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  815.   {
  816. test -n "$verbose" && \
  817. echo '    defining' STACK_DIRECTION to be '1'
  818. DEFS="$DEFS -DSTACK_DIRECTION=1"
  819. }
  820.  
  821. else
  822.   {
  823. test -n "$verbose" && \
  824. echo '    defining' STACK_DIRECTION to be '-1'
  825. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  826. }
  827.  
  828. fi
  829. fi
  830. rm -f conftest*
  831. fi
  832. fi
  833.  
  834. echo checking for return type of signal handlers
  835. cat > conftest.c <<EOF
  836. #include <sys/types.h>
  837. #include <signal.h>
  838. #ifdef signal
  839. #undef signal
  840. #endif
  841. extern int (*signal ()) ();
  842. int main() { exit(0); }
  843. int t() { int i; }
  844. EOF
  845. if eval $compile; then
  846.   {
  847. test -n "$verbose" && \
  848. echo '    defining' RETSIGTYPE to be 'int'
  849. DEFS="$DEFS -DRETSIGTYPE=int"
  850. }
  851.  
  852. fi
  853. rm -f conftest*
  854.  
  855.  
  856. echo checking for size_t in sys/types.h
  857. echo '#include <sys/types.h>' > conftest.c
  858. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  859. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  860.   :
  861. else
  862.   {
  863. test -n "$verbose" && \
  864. echo '    defining' size_t to be 'unsigned'
  865. DEFS="$DEFS -Dsize_t=unsigned"
  866. }
  867.  
  868. fi
  869. rm -f conftest*
  870.  
  871. echo '#include <sys/types.h>' > conftest.c
  872. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  873. if egrep "off_t" conftest.out >/dev/null 2>&1; then
  874.   :
  875. else
  876.   {
  877. test -n "$verbose" && \
  878. echo '    defining' NO_OFF_T
  879. DEFS="$DEFS -DNO_OFF_T=1"
  880. }
  881.  
  882. fi
  883. rm -f conftest*
  884.  
  885. echo "checking if \`#!' works in shell scripts"
  886. cat <<'__EOF__' > conftest.csh
  887. #!/bin/csh -f
  888. setenv SHELL /bin/csh
  889. # Avoid tcsh bug 'Bad Hertz Value':
  890. setenv HZ 60
  891. # Make sure foo doesn't get exported into the environment
  892. # Astoundingly, some versions of csh don't have unsetenv.
  893. if (${?foo}) unsetenv foo >& /dev/null
  894. if (${?foo}) unset foo
  895. set output="`./conftest.sh`"
  896. if ( "$output" == "foo=bar" ) then
  897.    exit 0
  898. endif
  899. exit 1
  900. __EOF__
  901. cat <<'__EOF__' > conftest.sh
  902. #!/bin/sh
  903. set foo=bar
  904. echo "$*"
  905. __EOF__
  906. chmod 777 conftest.csh conftest.sh
  907. (csh -f ./conftest.csh) 2> /dev/null
  908. if test $? = 0 ; then
  909.    :; SEDCMD="1d"
  910. else
  911.    :; SEDCMD=""
  912. fi
  913. rm -f conftest.csh conftest.sh
  914.  
  915. if test -z "$prefix"
  916. then
  917.   echo checking for gzip to derive installation directory prefix
  918.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="$IFS:"
  919.   for dir in $PATH; do
  920.     test -z "$dir" && dir=.
  921.     if test $dir != . && test -f $dir/gzip; then
  922.       # Not all systems have dirname.
  923.       prefix=`echo $dir|sed 's%/[^/][^/]*$%%'`
  924.       break
  925.     fi
  926.   done
  927.   IFS="$saveifs"
  928.   echo "    chose installation directory prefix ${prefix}"
  929. fi
  930.  
  931. if test -n "$prefix"; then
  932.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  933.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  934. fi
  935. if test -n "$exec_prefix"; then
  936.   prsub="$prsub
  937. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  938. exec_prefix\\1=\\2$exec_prefix%"
  939. fi
  940. cat >conftest.def <<EOF
  941. $DEFS
  942. EOF
  943. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  944. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  945. rm -f conftest.def
  946.  
  947. trap 'rm -f config.status; exit 1' 1 3 15
  948. echo creating config.status
  949. rm -f config.status
  950. cat > config.status <<EOF
  951. #!/bin/sh
  952. # Generated automatically by configure.
  953. # Run this file to recreate the current configuration.
  954. # This directory was configured as follows,
  955. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  956. #
  957. # $0 $*
  958.  
  959. for arg
  960. do
  961.   case "\$arg" in
  962.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  963.     exec /bin/sh $0 $* ;;
  964.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  965.   esac
  966. done
  967.  
  968. trap 'rm -f Makefile; exit 1' 1 3 15
  969. CC='$CC'
  970. INSTALL='$INSTALL'
  971. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  972. INSTALL_DATA='$INSTALL_DATA'
  973. CPP='$CPP'
  974. ALLOCA='$ALLOCA'
  975. CFLAGS='$CFLAGS'
  976. OBJA='$OBJA'
  977. SEDCMD='$SEDCMD'
  978. LIBS='$LIBS'
  979. srcdir='$srcdir'
  980. DEFS='$DEFS'
  981. prefix='$prefix'
  982. exec_prefix='$exec_prefix'
  983. prsub='$prsub'
  984. EOF
  985. cat >> config.status <<\EOF
  986.  
  987. top_srcdir=$srcdir
  988.  
  989. # Allow make-time overrides of the generated file list.
  990. test -n "$gen_files" || gen_files="Makefile"
  991.  
  992. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  993.   srcdir=$top_srcdir
  994.   # Remove last slash and all that follows it.  Not all systems have dirname.
  995.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  996.   if test "$dir" != "$file"; then
  997.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  998.     test ! -d $dir && mkdir $dir
  999.   fi
  1000.   echo creating $file
  1001.   rm -f $file
  1002.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  1003.   sed -e "
  1004. $prsub
  1005. s%@CC@%$CC%g
  1006. s%@INSTALL@%$INSTALL%g
  1007. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1008. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1009. s%@CPP@%$CPP%g
  1010. s%@ALLOCA@%$ALLOCA%g
  1011. s%@CFLAGS@%$CFLAGS%g
  1012. s%@OBJA@%$OBJA%g
  1013. s%@SEDCMD@%$SEDCMD%g
  1014. s%@LIBS@%$LIBS%g
  1015. s%@srcdir@%$srcdir%g
  1016. s%@DEFS@%$DEFS%
  1017. " $top_srcdir/${file}.in >> $file
  1018. fi; done
  1019.  
  1020. exit 0
  1021. EOF
  1022. chmod +x config.status
  1023. test -n "$no_create" || ./config.status
  1024.  
  1025.